<?php
echo $this->adminToolBar('project', 'index', '/project/addproject/', '/project/editproject/', '/project/deleteproject/');
?>
<?php
if(count($this->project_arr) > 0)
{
?>
<table border="1" width="98%" cellpadding="1" cellspacing="2" class="box-table-a">
	<tr>
		<th align="center" scope="col" width="3%">#</th>
		<th align="center" scope="col" width="15%">Project Title</th>
		<th align="center" scope="col" width="12%">Project Type</th>
		<th align="center" scope="col" width="15%">Customer</th>
		<th align="center" scope="col" width="15%">Business Solution Executive</th>
		<th align="center" scope="col" width="15%">Project Leader</th>
		<th align="center" scope="col" width="15%">Developer</th>
		<th align="center" scope="col" width="4%">Status</th>
		<th align="center" scope="col" width="3%">&nbsp;</th>
		<th align="center" scope="col" width="3%">&nbsp;</th>
		<th align="center" scope="col" width="3%">&nbsp;</th>
	</tr>

<?php
foreach($this->project_arr as $project_entry) : 
	$project_type = $project_entry['project_type'];
	switch($project_type)
	{
		case "sap" :
			$project = "SAP";
			break;
		
		case "accpac" :
			$project = "Accpac";
			break;
			
		case "sap_development" :		
			$project = "SAP + Development";
			break;
			
		case "accpac_development" :	
			$project = "Accpac + Development";
			break;
			
		case "sap_support" :
			$project = "SAP Support Service";
			break;
			
		case "accpac_support" :
			$project = "Accpac Support Service";
			break;	
			
		case "devlopment" :
			$project = "Devlopment";
			break;	
	}
	
	$bse_name = $project_entry['BSE_FNAME'] . " " . $project_entry['BSE_LNAME'];
	$pl_name = $project_entry['PL_FNAME'] . " " . $project_entry['PL_LNAME'];
	$dev_name = $project_entry['DEV_FNAME'] . " " . $project_entry['DEV_LNAME'];
?>
	<tr>
	    <td align="center"><?php echo $project_entry['project_id']; ?></td>
	    <td><?php echo $project_entry['project_title']; ?></td>
	    <td align="center"><?php echo $project; ?></td>
	    <td align="center"><?php echo $project_entry['customer_name']; ?></td>
	    <td align="center"><?php echo $bse_name; ?></td>	    
	    <td align="center"><?php echo $pl_name; ?></td>
	    <td align="center"><?php echo $dev_name; ?></td>
	    <td align="center"><?php echo $project_entry['status']; ?></td>	    
	    <td align="center"><a href="javascript: void(0);" onclick="loadPage('/project/edit/project_id/<?php echo $project_entry['project_id']; ?>');" title="Edit"><img src="/images/icons/edit.gif" alt=""/></a></td>
	    <td align="center"><a href="javascript: void(0);" onclick="showProjectUserPopup(<?php echo $project_entry['project_id']; ?>);" title="Assign Users"><img src="/images/icons/users.gif" alt=""/></a></td> 
	    <td align="center"><a href="javascript: void(0);" onclick="deleteProject('<?php echo $project_entry['project_id']; ?>');" title="Delete"><img src="/images/icons/disable.gif" alt=""/></a></td> 
	</tr>
<?php endforeach; ?>
</table>
<?php
} else {
?>
	<table border="0" width="98%" cellpadding="1" cellspacing="2">
		<tr>
			<td align="center" class="no_data">No records to show</td>
		</tr>
	</table>
<?php
}
?>
<div id="show_adduser_form" style="display: none;" title="Add User">
	<div id="table_content"></div>
</div>
<div id="formprjusers" title="Add Transport" style="display: none;">
	<div id="formprjusersdata"></div>
</div>